import React, { Component } from 'react'
import './index.scss'
export default class TableSelect extends Component {
    constructor(props){
        super(props)
        this.state={
            listShow:false
        }
    }
    showList(){
        this.setState({
            listShow:!this.state.listShow
        })
    }
    render() {
        const  {fieldData} = this.props,
               {listShow} = this.state;
        return (
            <div className="table-select">
                <div className="value-show"></div>
                <ul className={["option-list",listShow ? 'show' :''].join(' ')}
                    
                >
                    {
                        fieldData.map((item,index)=>{
                            return(
                                <li
                                    className="option-item"
                                    key={index}
                            >{item.title}</li>
                            )
                        })
                    }
                </ul>
            </div>
        )
    }
}
